<!DOCTYPE html>
<html>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>课程管理|<{$configcache['Title']}></title>
    <link rel="stylesheet" type="text/css" href="__CSS__/content.css"  />
    <link rel="stylesheet" type="text/css" href="__CSS__/public.css"  />
    <script type="text/javascript" src="__JS__/jquery.js"></script>
    <script type="text/javascript" src="__JS__/Public.js"></script>
    <script type="text/javascript" src="__JS__/winpop.js"></script>
    <script type="text/javascript" src="__JS__/My97DatePicker/WdatePicker.js"></script>
    <script type="text/javascript" src="__JS__/layer/layer.js"></script>
    <link rel="stylesheet" type="text/css" href="__JS__/layer/skin/layer.css" />
    <style type="text/css">
    .select{padding:5px 10px;border:#ddd 1px solid;border-radius:4px;width:60%;margin:5% auto;font-size:12px}
    .select li{list-style:none;padding:10px 0 5px 100px}
    .select .select-list{border-bottom:#eee 1px dashed}
    .select dl{zoom:1;position:relative;line-height:24px;}
    .select dl:after{content:" ";display:block;clear:both;height:0;overflow:hidden}
    .select dt{width:100px;margin-bottom:5px;position:absolute;top:0;left:-100px;text-align:right;color:#666;height:24px;line-height:24px}
    .select dd{float:left;display:inline;margin:0 0 5px 5px;}
    .select a{display:inline-block;white-space:nowrap;height:24px;padding:0 10px;text-decoration:none;color:#039;border-radius:2px;}
    .select a:hover{color:#f60;background-color:#f3edc2}
    .select .selected a{color:#fff;background-color:#f60}
    .select-result dt{font-weight:bold}
    .select-no{color:#999}
    .select .select-result a{padding-right:20px;background:#f60 url("__PUBLIC__/image/close.gif") right 9px no-repeat}
    .select .select-result a:hover{background-position:right -15px}
    .tc{text-align:center; text-indent:0;font-family:"微软雅黑";font-size: 14px;color:#111;}
    .fixed_w { width:100px; }
    .fixed_w .oper { padding:0px 6px; color:#060; }
    </style>
</head>
<body>
    <div id="content">
        <h1>首页 > 新闻列表 > 合作基地列表</h1>
        <h2>
            <div class="h2_left">
                <a href="__ACTION__" class="whole">全部</a>
                <a href="javascript:;" class="f5" onclick="f5();">刷新</a>
                <a href="javascript:history.back();" class="Retreat">后退</a>
                <a href="javascript:history.go(1);" class="Advance">前进</a>
            </div>
        </h2>

        <table id="table" border="1" bordercolor="#CCCCCC" cellpadding="0" cellspacing="0">
            <tr>
                <th>标题</th>
                <th>是否置顶</th>
                <th>时间</th>
                <th>状态</th>
                <th>审核</th>
                <th>操作</th>
            </tr>
            <volist name="base" id="vo">
                <tr>
                    <td style="text-align:center" class='tc'><{$vo.title}></td>
                    <td class="tc">
                        <!-- 使用switch标签判断输出 -->
                        <switch name="vo.isTop">
                            <case value="1">置顶</case>
                            <case value="0">否</case>
                            <default />否
                        </switch>
                        <a href="javascript:;" class="top" status = '1' style="color:#FF9933" sid='<{$vo.sid}>'>推荐</a>&nbsp;&nbsp;<a href="javascript:;" class="notop" status = '0' style="color:#FF9933" sid='<{$vo.sid}>'>不推荐</a>
                    </td>
                    <td style="text-align:center" class='tc'><{$vo.createTime}></td>
                    <td style="text-align:center" class='tc'>
                        <switch name="vo.checkStatus">
                            <case value="0">待审核</case>
                            <case value="1">审核通过</case>
                            <case value="2">审核失败</case>
                            <default/>
                        </switch>
                    </td>

                    <td class="tc fixed_w">
                        <switch name="vo.checkStatus">
                            <case value="0"><a href="javascript:;" class="pass" status = '1' style="color:#FF9933" sid='<{$vo.sid}>'>通过</a>&nbsp;&nbsp;<a href="javascript:;" class="nopass" status = '2' style="color:#FF9933" sid='<{$vo.sid}>'>不通过</a></case>
                            <case value="1">已审核<a href="javascript:;" class="pass" status = '1' style="color:#FF9933" sid='<{$vo.sid}>'>通过</a>&nbsp;&nbsp;<a href="javascript:;" class="nopass" status = '2' style="color:#FF9933" sid='<{$vo.sid}>'>不通过</a></case>
                            <case value="2">已审核<a href="javascript:;" class="pass" status = '1' style="color:#FF9933" sid='<{$vo.sid}>'>通过</a>&nbsp;&nbsp;<a href="javascript:;" class="nopass" status = '2' style="color:#FF9933" sid='<{$vo.sid}>'>不通过</a></case>
                            <default/>
                        </switch>
                    </td>
                    <td class="tc fixed_w"><a href="__APP__/News/edit/sid/<{$vo.sid}>" class="edit oper">修改</a><div style="cursor:pointer;color:red;" onclick="delapp('<{$vo.sid}>');">删除</div></td>
                </tr>
            </volist>
        </table>
        <div id="page">
            <{$page}>
        </div>
    </div>

    <script>

 $('.top').click(function(){
        var sid= ($(this).attr('sid'));
        $.ajax({
            type: "POST",
            url: "<{$url}>/eduWeb/news/updateNewIstop",
            data: {istop:1,sid:sid},
            success: function(data){
                if(data.code == 2000){
                    alert('通过');
                    f5();
                }else{
                    alert('网络异常,请稍后再试');
                }
            }
        });
    });

    $('.notop').click(function(){
        var sid= ($(this).attr('sid'));
     
            $.ajax({
                type: "POST",
                url: "<{$url}>/eduWeb/news/updateNewIstop",
                data: {istop:0,sid:sid},
                success: function(data){
                    if(data.code == 2000){
                        alert('不通过');
                        f5();
                    }else{
                        alert('网络异常,请稍后再试');
                    }
                }
            });
    });
    $('.pass').click(function(){
        var sid= ($(this).attr('sid'));
        $.ajax({
            type: "POST",
            url: "<{$url}>/eduWeb/news/updateNewStatus",
            data: {status:1,sid:sid,comment:'通过'},
            success: function(data){
                if(data.code == 2000){
                    alert('审核通过');
                    f5();
                }else{
                    alert('网络异常,请稍后再试');
                }
            }
        });
    });

    $('.nopass').click(function(){
        var sid= ($(this).attr('sid'));
        layer.prompt({title: '请输入拒绝原因', formType: 2}, function(comment, index){
            layer.close(index);
            $.ajax({
                type: "POST",
                url: "<{$url}>/eduWeb/news/updateNewStatus",
                data: {status:2,sid:sid,comment:comment},
                success: function(data){
                    if(data.code == 2000){
                        alert('审核不通过');
                        f5();
                    }else{
                        alert('网络异常,请稍后再试');
                    }
                }
            });
        });
    });

    function delapp(sid){
        $.ajax( {
            url:'<{$url}>/eduWeb/news/deleteNews',// 跳转到 action
            data:{sid:sid},
            type:'post',
            cache:false,
            dataType:'json',
            success:function(data) {
                if(data.code =="2000" ){
                    alert(data.message);
                    location.reload();
                }else{
                    alert(data.message);
                }
            },
            error : function() {
                alert("异常！");
            }
        });
    }
    </script>

</body>
</html>
